﻿-- =============================================
-- Script Template
-- =============================================
create view viewPlayWinLotteryNumber --查询采种开奖的所有彩种信息
as	  
select Id, CreateTime, LotteryID, PlayNo, PlayName, StartTime, EndTime, WinLotteryNumber, StateUpdatetime, PlayState,row_number()over(partition by LotteryID order by EndTime desc) rnsum from pm_plays where Endtime<getdate() and WinLotteryNumber<>('') 
